@extends('template.adminpage')
@section('content')
 
<ol class="breadcrumb">
  <li class="active">Bonus config</li>
</ol>

<div class="container-black" style="height:250px">

  <label style="margin-top:10px"><u>Besaran bonus</u></label>
    <br>

     <div class="table-responsive">
  	 <table class="table table-bordered table-hover">
      <thead>
        <tr>
          <th>No</th>
          <th>Nama bonus</th>
          <th>Jumlah bonus</th>
          <th>Aksi</th>
        </tr>
      </thead>
      <tbody>
        <tr>
        <?php  
        $limit = 10;
        if(Input::get('page')==0 OR Input::get('page')==1){ 
         $no = 1;
        }
        else{
        $no = ((Input::get('page')-1)*$limit)+1;
        }
       ?>
       @foreach($databonus as $bonus)
         <td>{{$no}}</td>
         <td>{{$bonus->bonus_config_name}}</td>
         <td>{{round($bonus->bonus_config_percentage,2)}} Per order / Per referal</td>

          <td ><a data-toggle="modal" data-target="#ubah{{$bonus->bonus_config_id}}" title="Ubah Password Agen"><button class="btn btn-xs btn-dark"><span class="fa fa-edit"></span> Ubah</button></a></td>
        <?php $no++; ?>
      </tr>
      @endforeach
      </tbody>


    </table>
  </div>

     @foreach($databonus as $bonus)
              <div class="modal fade" id="ubah{{$bonus->bonus_config_id}}" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
 
                    <h4 align="center" class="modal-title"> <label style="margin-top:5px; margin-bottom:25px">Ganti besaran bonus</label></h4>
                    </div>
                    <div align="left">
                              {{Form::open(array(
                                    'url' => '/bonus/edit/'.$bonus->bonus_config_id,
                                    'method' => 'POST'
                                  ))}}
                              <div class="row" style="margin-top:10px">
                              <div class="col-md-10 col-md-offset-1">

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Bonus lama</label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text" class="form-control" style="width:200px;height:30px" value="{{round($bonus->bonus_config_percentage,2)}}" disabled /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5">
                                  <label>Bonus baru <font color="red">*</font></label>
                                  </div>
                                  <div class="col-lg-5">
                                    <input type="text" placeholder="Masukan bonus baru" name="bonus" class="form-control" style="width:200px;height:30px" required  /></input>
                                  </div>
                                  </div>
                                  <br>

                                  <div class="row">
                                  <div class="col-lg-5 col-lg-offset-5">
                                 <font color="red">* Data tidak boleh kosong</font><br>
                                  </div>
                                  </div>

                              </div> 
                              </div>   
                    
                    </div>
                    <div class="modal-footer">
                    <button type="submit" class="btn btn-sm btn-dark"><span class="fa fa-floppy-o"></span> Simpan</button>{{Form::close()}} <button class="btn btn-sm btn-dark" style="margin-right:5px" class="close" data-dismiss="modal"><span class="fa fa-times"></span> Batal</button></a>
                         
                    </div>
                  </div>
                </div>
              </div>
@endforeach

</div>


@stop
@stop